var url = '';
var jsonData = '';

$(function() {
});

function loginbtn() {
	var name = $("#userName").val();
	var password = $("#userPwd").val();
	console.log(name+"----"+password);
	url =  ctx+'/login';
	jsonData = {name:name,password:password};
	var dataObj = commonAjax();
	//studentMessageHtml(dataObj.user);
}


/*function studentMessageHtml(data) {
	var returnHtml ='';
	 $('#userInfo').html(returnHtml);
}*/

function commonAjax(){
	console.log("in ajax");
	var result = '';
 	$.ajax({
		type : "GET",
		url: url,
	 	data : jsonData,
	 	async: false,
		dataType : "json",
		success: function(data) {
				result = data;
			}
		});
 	return result;
}